<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<%@ page pageEncoding="UTF-8"%>
<html>
<head>
	<jsp:include page="/common/comm.jsp" />
    <script>
    $(function() {
    jQuery("#editgrid").jqGrid({
    	url:'/ssmWeb/demo/grid-user.action', 
    	datatype: "json",
    	colNames:['Id','birthday', 'sex', 'name'], 
    	colModel:[ 
    	           {name:'id',index:'id', jsonmap:'id',width:55,editable:false,editoptions:{readonly:true,size:10}}, 
    	           {name:'birthday',index:'birthday', jsonmap:'birthday', width:80,editable:true,editoptions:{size:10}}, 
    	           {name:'sex',index:'sex', jsonmap:'sex', width:90,editable:true,editoptions:{size:25}}, 
    	           {name:'name',index:'name', jsonmap:'name', width:100, sortable:false,editable: true,edittype:"textarea", editoptions:{rows:"2",cols:"20"}} 
    	         ], 
  	         jsonReader: {  
  	             root:"gridModel",       // (2)  
  	             records: "record",      // (3)  
  	             repeatitems : false     // (4)  
  	         } ,  
    	rowNum:10, 
    	rowList:[10,20,30], 
    	pager: '#pagered', 
    	sortname: 'id', 
    	viewrecords: true, 
    	sortorder: "desc", 
    	caption:"Editing Example", 
    	editurl:"someurl.php" 

    }); 
    
    $("#bedata").click(function(){ 
    	var gr = jQuery("#editgrid").jqGrid('getGridParam','selrow'); 
    	if( gr != null ) 
    		jQuery("#editgrid").jqGrid('editGridRow',gr,{height:280,reloadAfterSubmit:false}); else alert("Please Select Row"); 
    });
});
    </script>
   </head> 
 <body>
 <table id="editgrid"></table> 
 <div id="pagered"></div> 
 <input type="button" id="bedata" value="Edit Selected" />
 </body>   

</html>